package se.webbzon.oschi01.nbt;

import se.webbzon.oschi01.nbt.TagEvent.Action;

public class ByteTag extends AbstractTag<Byte> {
	
	private byte b;
	
	public ByteTag(TagFactory<Byte> factory, String tagName, byte b) {
		super(factory,tagName);
		this.b = b;
	}

	@Override public long size() {
		return 1;
	}

	@Override public Byte getValue() {
		return b;
	}

	@Override public void setValue(Byte value) {
		this.b = value;
		broadcastEvent(new TagEvent(this,Action.CHANGED,value));
	}

	@Override public Class<Byte> getValueClass() {
		return Byte.class;
	}

	@Override public ByteTag clone() {
		return new ByteTag(getFactory(),this.toString(),b);
	}

}
